home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-imgwiu.ads < prev    next >
Text File  |  1996-01-30  |  4KB  |  64 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                       S Y S T E M . I M G _ W I U                        --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.2 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  Contains the routine for computing the image  of signed and unsigned
  27. --  integers whose size <= Integer'Size for use by Text_Io.Integer_Io,
  28. --  Text_Io.Modular_Io, and the Img attribute when a width is given.
  29.  
  30. with System.Unsigned_Types;
  31.  
  32. package System.Img_WIU is
  33. pragma Preelaborate (Img_WIU);
  34.  
  35.    procedure Set_Image_Width_Integer
  36.      (V : Integer;
  37.       W : Integer;
  38.       S : out String;
  39.       P : in out Natural);
  40.    --  Sets the signed image of V in decimal format, starting at S (P + 1),
  41.    --  updating P to point to the last character stored. The image includes
  42.    --  a leading minus sign if necessary, but no leading spaces unless W is
  43.    --  positive, in which case leading spaces are output if necessary to ensure
  44.    --  that the output string is no less than W characters long. The caller
  45.    --  promises that the buffer is large enough and no check is made for this.
  46.    --  Constraint_Error will not necessarily be raised if this is violated,
  47.    --  since it is perfectly valid to compile this unit with checks off.
  48.  
  49.    procedure Set_Image_Width_Unsigned
  50.      (V : System.Unsigned_Types.Unsigned;
  51.       W : Integer;
  52.       S : out String;
  53.       P : in out Natural);
  54.    --  Sets the unsigned image of V in decimal format, starting at S (P + 1),
  55.    --  updating P to point to the last character stored. The image includes no
  56.    --  leading spaces unless W is positive, in which case leading spaces are
  57.    --  output if necessary to ensure that the output string is no less than
  58.    --  W characters long. The caller promises that the buffer is large enough
  59.    --  and no check is made for this. Constraint_Error will not necessarily be
  60.    --  raised if this is violated, since it is perfectly valid to compile this
  61.    --  unit with checks off.
  62.  
  63. end System.Img_WIU;
  64.